<%@ page language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <%@include file="/WEB-INF/common/hplus-css.jsp" %>
    <%@include file="/WEB-INF/common/hplus-js.jsp" %>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="${pageContext.request.contextPath}/assets/hplus/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/hplus/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/hplus/css/animate.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/hplus/css/plugins/summernote/summernote.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/hplus/css/plugins/summernote/summernote-bs3.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/hplus/css/style.css?v=4.1.0" rel="stylesheet">

    <style type="text/css">
        #required {
            color: red;
        }
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-content">
                    <form action="${path}/user/add" class="form-horizontal m-t" id="userForm" method="post"
                          enctype="multipart/form-data">
                        <input type="hidden" name='orgId' value=''/>
                        <input name="pid" id="pid" type="hidden" value="">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">文章类型：</label>
                            <div class="col-sm-8">
                                <select name="type" class="col-sm-6" id="org"
                                        style=" height:26px; line-height:26px; text-align: center;">

                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">标题：</label>
                            <div class="col-sm-4">
                                <input type="text" id="name" minlength="2" class="form-control" onclick="choose()"
                                       placeholder="点击选择部门">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label"><span id="required">*</span>封面图片：</label>
                            <div class="col-sm-4">
                                <input type="text" name="name" class="form-control" aria-required="true"
                                       required="required" maxlength="11" placeholder="请输入用户名"
                                       onkeyup="value=value.replace(/[\u4e00-\u9fa5]/ig,'')">
                            </div>
                        </div>


                        <div class="row">
                            <div class="col-sm-12">
                                <div class="ibox float-e-margins">
                                    <div class="ibox-title">
                                        <h5>编辑内容</h5>
                                        <button id="edit" class="btn btn-primary btn-xs m-l-sm" onclick="edit()"
                                                type="button">编辑
                                        </button>
                                        <button id="save" class="btn btn-primary  btn-xs" onclick="save()"
                                                type="button">保存
                                        </button>
                                        <div class="ibox-tools">
                                            <a class="collapse-link">
                                                <i class="fa fa-chevron-up"></i>
                                            </a>

                                        </div>
                                    </div>
                                    <div class="ibox-content" id="eg">

                                        <div class="click2edit wrapper">

                                        </div>

                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                <button class="btn btn-primary" id="add-btn" type="button">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 全局js -->
<script src="${pageContext.request.contextPath}/assets/hplus/js/jquery.min.js?v=2.1.4"></script>
<script src="${pageContext.request.contextPath}/assets/hplus/js/bootstrap.min.js?v=3.3.6"></script>
<!-- 自定义js -->
<script src="${pageContext.request.contextPath}/assets/hplus/js/content.js?v=1.0.0"></script>
<!-- SUMMERNOTE -->
<script src="${pageContext.request.contextPath}/assets/hplus/js/plugins/summernote/summernote.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/hplus/js/plugins/summernote/summernote-zh-CN.js"></script>
<script>

    $(document).ready(function () {

     function edit() {
        $("#eg").addClass("no-padding");
        $('.click2edit').summernote({
            lang: 'zh-CN',
            focus: true
        });
    };

     function save() {
        $("#eg").removeClass("no-padding");
        var aHTML = $('.click2edit').code(); // 这是编辑好的源码 图片以base64编码存储
        parent.getHTML(aHTML);

        $('.click2edit').destroy();
    };


    });



</script>

</body>
</html>
